home *** CD-ROM | disk | FTP | other *** search
- Subject: Re:Undo Set Property
- Sent: 8/7/96 7:07 AM
- Received: 8/7/96 8:55 AM
- From: Serge Froment, sfroment@odyssee.net
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >I'm not sure you need to override FW_CSetPropertyCommand. When a
- >FW_CSetPropertyCommand is performed, the SetProperty method of the object
- >whose property is being set is called. SetProperty is virtual. I suspect
- >you'll be able to implement the functionality you need by override
- >SetProperty and/or GetProperty in your part. There is nothing stopping you
- >from doing whatever you want when these methods are called. I think this
- >method is the most straightforward, and you should be able to do what you
- >want.
-
- Well, I realize I was not clear. The problem is with Undo support:
- FW_CSetPropertyCommand saves the old property and restore it, but it cannot
- restore the other properties that are modified as a side effect.
-
- >If you _really_ want to mess with FW_CSetProperty command, you'll have to
- >do more work. You'll need to override the GetContainedObject method of the
- >scriptable object whose property is being set. Within that method, you'll
- >need to return a subclass (which you define and implement) of
- >FW_CPropertyDesignator, that overrides DoAESetData. When your subclass's
- >DoAESetData method is called, you'll have to create and execute either a
- >subclass of FW_CSetPropertyCommand, or a subclass of FW_CCommand (that you
- >define and implement). This subclass can do whatever you want in its DoIt,
- >UndoIt, and RedoIt method. Be _very_ careful to make sure that you
- >implement a scheme for reference counting so that objects involved in undo
- >are kept around when necessary, and are deleted when you are through with
- >them.
-
- May I suggest that FW_CPropertyDesignator call a method of FW_CPart to
- create the FW_CSetPropertyCommand? If you can do this or something similar
- for ODF 2, I will file my incomplete Undo support as a bug to be corrected
- once ODF 2 is out.
-
- Serge
-
- PS: Did you received the message I sent you yesterday at
- friedman@cognosis.com regarding adding part properties?
-
-
-